home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / util / libs / MailPro.lha / MailProLibrary / autodocs / mailpro.doc
Encoding:
Text File  |  1999-03-06  |  41.0 KB  |  1,371 lines

  1. TABLE OF CONTENTS
  2.  
  3. mailpro.library/--background--
  4. mailpro.library/MP_AllocArchiverList
  5. mailpro.library/MP_AllocPacket
  6. mailpro.library/MP_CreateEntry
  7. mailpro.library/MP_CreateMessage
  8. mailpro.library/MP_CreatePacket
  9. mailpro.library/MP_CvtEndianLong
  10. mailpro.library/MP_CvtEndianWord
  11. mailpro.library/MP_DeleteEntry
  12. mailpro.library/MP_DeleteMessage
  13. mailpro.library/MP_FindEntry
  14. mailpro.library/MP_FreeArchiverList
  15. mailpro.library/MP_FreePacket
  16. mailpro.library/MP_IdentifyArchive
  17. mailpro.library/MP_InsertArchiver
  18. mailpro.library/MP_InsertEntry
  19. mailpro.library/MP_InsertMessage
  20. mailpro.library/MP_IsFile
  21. mailpro.library/MP_NextArchiver
  22. mailpro.library/MP_NextEntry
  23. mailpro.library/MP_NextMessage
  24. mailpro.library/MP_Pack
  25. mailpro.library/MP_PrevArchiver
  26. mailpro.library/MP_PrevEntry
  27. mailpro.library/MP_PrevMessage
  28. mailpro.library/MP_RemoveArchiver
  29. mailpro.library/MP_RootMessage
  30. mailpro.library/MP_RootPacket
  31. mailpro.library/MP_SavePacket
  32. mailpro.library/MP_ToArchiver
  33. mailpro.library/MP_ToEntry
  34. mailpro.library/MP_ToMessage
  35. mailpro.library/MP_UniqueName
  36. mailpro.library/MP_UnPack
  37.  
  38. mailpro.library/--background--       mailpro.library/--background--
  39.  
  40.    NAME
  41.        MailPro -- Mail Professional library.
  42.  
  43.    FUNCTION
  44.        This library was designed in helping programmers who creates
  45.        fido- or amiganet software like, for example, mail tossers,
  46.        mail processors etc.
  47.  
  48.    NOTES
  49.        There are some structures which are used by this library. At
  50.        main, you must know one rule: please avoid to creare these
  51.        structures yourself because ones have private fields inside!
  52.        Instead it please use library functions which can do it for
  53.        you. Also please note that as for now the library supports
  54.        only mail packets type 2 such us: 3D (FTS-0001), 4D (FSC-0048)
  55.        and 5D (FSC-0045).
  56.  
  57. mailpro.library/MP_IsFile            mailpro.library/MP_IsFile
  58.  
  59.    NAME
  60.        MP_IsFile - Tests file for needed mailtype.
  61.  
  62.    SYNOPSIS
  63.        result = MP_IsFile(filename, pattern, mailtype)
  64.          D0                  A0    A1   D0
  65.  
  66.        LONG MP_IsFile(STRPTR, STRPTR, ULONG)
  67.  
  68.    FUNCTION
  69.        This routine tests is the file suitable for selected
  70.        mailtype. It is possible to check it as by file name
  71.        pattern as by internal recognization routines.
  72.        You must specify at least one criteria for the test.
  73.        If none criterias are set then function returns 0L.
  74.  
  75.    INPUTS
  76.        filename -- a pointer to a file name (may contain path).
  77.  
  78.        pattern -- a pointer to the pattern string (like used
  79.           in AmigaDOS patterns). This parameter is used for
  80.           check the file name. There are some special values
  81.           for this parameter, such us:
  82.  
  83.           MPISFP_SIMPLE_PACKET
  84.                  for pattern "????????.PKT"
  85.  
  86.           MPISFP_SIMPLE_PACKET_SUFFIX
  87.                  for pattern "#?.PKT"
  88.  
  89.           MPISFP_PACKED_PACKET
  90.                  for pattern "????????.(SU|MO|TU|WE|TH|FR|SA)?"
  91.  
  92.           MPISFP_PACKED_PACKET_SUFFIX
  93.                  for pattern "#?.(O|H|D|C)UT"
  94.  
  95.           MPISFP_FILE_LIST
  96.                  for pattern "#?.(F|H|D|C)LO"
  97.  
  98.           MPISFP_TIC_FILE
  99.                  for pattern "????????.TIC"
  100.  
  101.           MPISFP_RDM_FILE
  102.                  for pattern "????????.RDM"
  103.  
  104.           MPISFP_DONT_USE
  105.                  if you don't need to check the mailtype by
  106.                  the pattern.
  107.  
  108.        type -- a type of recognized files, currently:
  109.  
  110.           MPISFT_PKT
  111.                  non packed type 2 mail packet (3D, 4D or 5D);
  112.  
  113.           MPISFT_BINARY
  114.                  binary file;
  115.  
  116.           MPISFT_TEXT
  117.                  text file;
  118.  
  119.           MPISFT_DONT_USE
  120.                  if you don't need to check the mailtype by
  121.                  internal library's routines.
  122.  
  123.    RESULTS
  124.        result -- 1L if test passed and 0L if don't. If any
  125.           error occurs while checking then library error
  126.           code will be returned. All internal error codes
  127.           are negative values.
  128.  
  129.    NOTE
  130.        Note that MP_IsFile does NOT recognize mailfile at 100%
  131.        cases if you use MPISFT_PKT for mailtype parameter. It
  132.        is because the mail files have not special ID fields
  133.        inside. So be carefull! You may use own check routines
  134.        if this function reports that test was passed.
  135.  
  136.    BUGS
  137.         This routine uses DOS function ParsePatternNoCase().
  138.         From dos autodocs about this function:
  139.  
  140.         In V37 this call didn't always set IoErr() to something
  141.         useful on an error.  Fixed in V39.
  142.         In V37, it didn't properly convert character-classes
  143.         ([x-y]) to upper case. Fixed in V39 dos.
  144.  
  145.         Workaround: Use upper case characters for pattern string.
  146.  
  147.    SEE ALSO
  148.        mail/mailpro.h
  149.  
  150. mailpro.library/MP_Pack              mailpro.library/MP_Pack
  151.  
  152.    NAME
  153.        MP_Pack - Pack files into simple archive.
  154.  
  155.    SYNOPSIS
  156.        error = MP_Pack(path, arcname, archiver, output)
  157.          D0                  A0    A1   A2    A3
  158.  
  159.        LONG MP_Pack(STRPTR, STRPTR, struct ArchiverNode *, STRPTR)
  160.  
  161.    FUNCTION
  162.        This routine packs all files from directory to simple
  163.        file by selected archiver/packer.
  164.  
  165.    INPUTS
  166.        path -- a directory in where files for packing are placed.
  167.        arcname -- full path and name of archive in which files
  168.           will be packed. Don't use relations to current or
  169.           program directories here!
  170.        archiver -- a pointer to struct ArchiverNode which
  171.           describes the usage of archiver/packer.
  172.        output -- a name of file in which archiver/packer will
  173.           store report about its work. May be NULL if you don't
  174.           need with it.
  175.  
  176.    RESULTS
  177.        error -- 0L if all is okay. If any internal error
  178.           occurs then library error code will be returned.
  179.           All internal error codes are negative values.
  180.           If any external error of archiver/packer occurs
  181.           then this code will be returned as positive value.
  182.  
  183.    NOTE
  184.        Note that most archivers/packers return error codes
  185.        as standard shell error codes (5, 10, 20 etc).
  186.  
  187.    BUGS
  188.        None
  189.  
  190.    SEE ALSO
  191.        MP_UnPack(), MP_AllocArchiverList(), MP_FreeArchiverList(),
  192.        MP_InsertArchiver(), MP_RemoveArchiver(),
  193.        MP_NextArchiver(), MP_PrevArchiver(), MP_ToArchiver(),
  194.        MP_IdentifyArchive()
  195.  
  196. mailpro.library/MP_UnPack            mailpro.library/MP_UnPack
  197.  
  198.    NAME
  199.        MP_UnPack - Unpack archive into directory.
  200.  
  201.    SYNOPSIS
  202.        error = MP_UnPack(arcname, path, archiverlist, output)
  203.          D0                  A0    A1   A2   A3
  204.  
  205.        LONG MP_UnPack(STRPTR, STRPTR, struct List *, STRPTR)
  206.  
  207.    FUNCTION
  208.        This routine unpacks the archive into directory. Routine does
  209.        auto recognization for needed archiver/unpacker by tracing the
  210.        list of nodes each one is struct ArchiverNode.
  211.  
  212.    INPUTS
  213.        arcname -- full path and name of archive for unpacking. Don't
  214.           use relations to current or program directories here!
  215.        path -- a name of directory in which files will be unpacked.
  216.        archiverlist -- a pointer to struct List which links
  217.           descriptions of all available archivers/unpackers.
  218.        output -- a name of file in which archiver/unpacker will
  219.           store report about its work. May be NULL if you don't
  220.           need with it.
  221.  
  222.    RESULTS
  223.        error -- 0L if all is okay. If any internal error
  224.           occurs then library error code will be returned.
  225.           All internal error codes are negative values.
  226.           If any external error of archiver/unpacker occurs
  227.           then this code will be returned as positive value.
  228.  
  229.  
  230.    NOTE
  231.        Note that most archivers/unpackers return error codes
  232.        as standard shell error codes (5, 10, 20 etc).
  233.  
  234.    BUGS
  235.        None
  236.  
  237.    SEE ALSO
  238.        MP_Pack(), MP_AllocArchiverList(), MP_FreeArchiverList(),
  239.        MP_InsertArchiver(), MP_RemoveArchiver(),
  240.        MP_NextArchiver(), MP_PrevArchiver(), MP_ToArchiver(),
  241.        MP_IdentifyArchive()
  242.  
  243. mailpro.library/MP_AllocPacket       mailpro.library/MP_AllocPacket
  244.  
  245.    NAME
  246.        MP_AllocPacket - Allocate and trace mail packet.
  247.  
  248.    SYNOPSIS
  249.        packet = MP_AllocPacket(filename, error)
  250.          D0                  A0    A1
  251.  
  252.        struct MailPacket *MP_AllocPacket(STRPTR, LONG *)
  253.  
  254.    FUNCTION
  255.        This routine allocates memory for mail packet, loads and
  256.        traces it. The routine makes database of the packet by
  257.        creation of the lists and nodes. Any message of packet
  258.        will be linked into messages' list which is in the
  259.        struct MailPacket. Any entry of each message will be
  260.        linked into entries' list which is in the struct MailMessage.
  261.  
  262.    INPUTS
  263.        filename -- a name of file which is mail NON packed packet.
  264.        error -- a pointer to LONG value where any error code will
  265.           be placed. This parameter may be NULL. In this case error
  266.           code will not be placed anywhere.
  267.  
  268.    RESULTS
  269.        packet -- a pointer to struct MailPacket which contains
  270.           database of mail packet. Or NULL if any error occurs.
  271.  
  272.    NOTE
  273.        Always deallocate memory by MP_FreePacket() if you
  274.        don't need to work with packet anymore. Also note that
  275.        this routine does NOT check selected file for comtability
  276.        to mail packet. You may do it yourself by MP_IsFile().
  277.  
  278.    BUGS
  279.        None
  280.  
  281.    SEE ALSO
  282.        MP_FreePacket(), MP_CreatePacket(), MP_SavePacket()
  283.  
  284. mailpro.library/MP_FreePacket        mailpro.library/MP_FreePacket
  285.  
  286.    NAME
  287.        MP_FreePacket - Free memory allocated for packet and database.
  288.  
  289.    SYNOPSIS
  290.        MP_FreePacket(packet)
  291.                              A0
  292.  
  293.        void MP_FreePacket(struct MailPacket *)
  294.  
  295.    FUNCTION
  296.        This routine deallocates all memory which was allocalted by
  297.        MP_AllocPacket() or by MP_CreatePacket() including memory of
  298.        all mail messages and entries which are linked in this packet.
  299.  
  300.    INPUTS
  301.        packet -- a pointer to a struct MailPacket which was created
  302.           by MP_AllocPacket() or by MP_CreatePacket().
  303.  
  304.    RESULTS
  305.  
  306.    NOTE
  307.        Do not call this routine for any objects allocated in other way.
  308.        Also note that after this call you must never use struct MailPacket
  309.        which was freed.
  310.  
  311.    BUGS
  312.        None
  313.  
  314.    SEE ALSO
  315.        MP_AllocPacket(), MP_CreatePacket(), MP_SavePacket()
  316.  
  317. mailpro.library/MP_NextMessage       mailpro.library/MP_NextMessage
  318.  
  319.    NAME
  320.        MP_NextMessage - Go to next packet message after indicated.
  321.  
  322.    SYNOPSIS
  323.        message = MP_NextMessage(message)
  324.          D0                  A0
  325.  
  326.        struct MailMessage *MP_NextMessage(struct MailMessage *)
  327.  
  328.    FUNCTION
  329.        This routine returns pointer to the next packet message
  330.        which is after selected.
  331.  
  332.    INPUTS
  333.        message -- a pointer to the current struct MailMessage.
  334.  
  335.    RESULTS
  336.        message -- a pointer to the next struct MailMessage.
  337.           This routine returns NULL if current message is last
  338.           message in the mail packet (there are no more messages
  339.           after current one). This routine also returns NULL
  340.           if you indicated the message which isn't linked into
  341.           any mail packet.
  342.  
  343.    NOTE
  344.  
  345.    BUGS
  346.        None
  347.  
  348.    SEE ALSO
  349.        MP_PrevMessage(), MP_ToMessage(), MP_CreateMessage(),
  350.        MP_InsertMessage(), MP_DeleteMessage()
  351.  
  352. mailpro.library/MP_NextEntry         mailpro.library/MP_NextEntry
  353.  
  354.    NAME
  355.        MP_NextEntry - Go to next message entry after indicated.
  356.  
  357.    SYNOPSIS
  358.        entry = MP_NextEntry(entry)
  359.          D0                  A0
  360.  
  361.        struct MessageEntry *MP_NextEntry(struct MessageEntry *)
  362.  
  363.    FUNCTION
  364.        This routine returns pointer to the next message entry
  365.        which is after selected.
  366.  
  367.    INPUTS
  368.        entry -- a pointer to the current struct MessageEntry.
  369.  
  370.    RESULTS
  371.        entry -- a pointer to the next struct MessageEntry.
  372.           This routine returns NULL if current entry is last
  373.           entry in the packet message (there are no more
  374.           entries after current one). This routine also returns
  375.           NULL if you indicated the entry which isn't linked into
  376.           any mail message.
  377.  
  378.    NOTE
  379.  
  380.    BUGS
  381.        None
  382.  
  383.    SEE ALSO
  384.        MP_PrevEntry(), MP_ToEntry(), MP_FindEntry(), MP_CreateEntry(),
  385.        MP_InsertEntry(), MP_DeleteEntry()
  386.  
  387. mailpro.library/MP_ToMessage         mailpro.library/MP_ToMessage
  388.  
  389.    NAME
  390.        MP_ToMessage - Go to packet message by number of one.
  391.  
  392.    SYNOPSIS
  393.        message = MP_ToMessage(packet, number)
  394.          D0                  A0    D0
  395.  
  396.        struct MailMessage *MP_ToMessage(struct MailPacket *,  ULONG)
  397.  
  398.    FUNCTION
  399.        This routine returns pointer to the packet message by the
  400.        number of one.
  401.  
  402.    INPUTS
  403.        packet -- a pointer to struct MailPacket.
  404.        number -- a number of message in the packet (0, 1 etc).
  405.  
  406.    RESULTS
  407.        message -- a pointer to struct MailMessage.
  408.           This routine returns NULL if message with selected number
  409.           is absent in the mail packet.
  410.  
  411.    NOTE
  412.  
  413.    BUGS
  414.        None
  415.  
  416.    SEE ALSO
  417.        MP_NextMessage(), MP_PrevMessage(), MP_CreateMessage(),
  418.        MP_InsertMessage(), MP_DeleteMessage()
  419.  
  420. mailpro.library/MP_ToEntry           mailpro.library/MP_ToEntry
  421.  
  422.    NAME
  423.        MP_ToEntry - Go to message entry by number of one.
  424.  
  425.    SYNOPSIS
  426.        entry = MP_ToEntry(message, number)
  427.          D0                  A0    D0
  428.  
  429.        struct MessageEntry *MP_NextEntry(struct MailMessage *, ULONG)
  430.  
  431.    FUNCTION
  432.        This routine returns pointer to the message entry by the
  433.        number of one.
  434.  
  435.    INPUTS
  436.        message -- a pointer to struct MailMessage.
  437.        number -- a number of entry in the mesage (0, 1 etc).
  438.  
  439.    RESULTS
  440.        entry -- a pointer to struct MessageEntry.
  441.           This routine returns NULL if entry with selected number
  442.           is absent in the message.
  443.    NOTE
  444.  
  445.    BUGS
  446.        None
  447.  
  448.    SEE ALSO
  449.        MP_NextEntry(), MP_PrevEntry(), MP_FindEntry(), MP_CreateEntry(),
  450.        MP_InsertEntry(), MP_DeleteEntry()
  451.  
  452. mailpro.library/MP_FindEntry         mailpro.library/MP_FindEntry
  453.  
  454.    NAME
  455.        MP_FindEntry - Search selected entry in the message.
  456.  
  457.    SYNOPSIS
  458.        entry = MP_FindEntry(message, entry, id)
  459.          D0                  A0    A1   D0
  460.  
  461.        struct MessageEntry *MP_FindEntry(struct MailMessage *, struct MessageEntry *, ULONG)
  462.  
  463.    FUNCTION
  464.        This routine search message entry with selected identifier.
  465.        If you need to find the first entry with specifed identifier
  466.        then set entry to NULL. If you set this pointer to any other
  467.        entry then searching will be continued from the next entry
  468.        after it (for find multiple occurences).
  469.  
  470.    INPUTS
  471.        message -- a pointer to struct MailMessage which searching will
  472.           be done in.
  473.        entry -- a pointer to struct MessageEntry which searching will
  474.           be done after. It may be NULL for start search from the
  475.           beginning of message.
  476.        id -- an identifier of entry which you need to find. As for now
  477.           there are next identifiers:
  478.  
  479.           Main:
  480.  
  481.           MEID_DATE
  482.                  the date of message;
  483.           MEID_FROM
  484.                  the name of sender of message;
  485.           MEID_TO
  486.                  the name of receiver of message;
  487.           MEID_SUBJ
  488.                  the subject of message;
  489.           MEID_AREA
  490.                  the area which is message for;
  491.           MEID_BODY
  492.                  the body (text) of message;
  493.  
  494.           Main kludges:
  495.           MEID_KL_DOMAIN, MEID_KL_FRPT, MEID_KL_TOPT, MEID_KL_MSGID,
  496.           MEID_KL_PID, MEID_KL_REPLY, MEID_KL_CHRS, MEID_KL_TID,
  497.           MEID_KL_INTL, MEID_KL_PATH, MEID_KL_REALNAME, MEID_KL_GIF,
  498.           MEID_KL_EID, MEID_KL_VIA
  499.  
  500.           I-net kludges:
  501.           MEID_KL_XMAILER, MEID_KL_REPLYADDR, MEID_KL_INREPLYTO,
  502.           MEID_KL_RFC_PATH, MEID_KL_RFC_REF
  503.  
  504.           Mime kludges:
  505.           MEID_KL_MIMEVERSION, MEID_KL_CONTENTTYPE,
  506.           MEID_KL_CONTENTTREN, MEID_KL_RFC_MIMEVER,
  507.           MEID_KL_RFC_CONTYPE
  508.  
  509.           Special:
  510.           MEID_ENTRY_CORRUPTED
  511.                  corrupted entry;
  512.           MEID_ENTRY_EMPTY
  513.                  the empty entry;
  514.           MEID_ENTRY_UNKNOWN
  515.                  unknown entry.
  516.  
  517.    RESULTS
  518.        entry -- a pointer to struct MessageEntry.
  519.           This routine returns NULL if entry with selected identifier
  520.           was not found.
  521.  
  522.    NOTE
  523.  
  524.    BUGS
  525.        None
  526.  
  527.    SEE ALSO
  528.        MP_ToEntry(), MP_NextEntry(), MP_PrevEntry(), MP_CreateEntry(),
  529.        MP_InsertEntry(), MP_DeleteEntry(), mail/mailpro.h
  530.  
  531. mailpro.library/MP_AllocArchiverList mailpro.library/MP_AllocArchiverList
  532.  
  533.    NAME
  534.        MP_AllocArchiverList - Allocale and initializate archivers' list.
  535.  
  536.    SYNOPSIS
  537.        archiverlist = MP_AllocArchiverList()
  538.          D0
  539.  
  540.        struct List *MP_AllocArchiverList(void)
  541.  
  542.    FUNCTION
  543.        This routine allocates memory for struct List, initializates
  544.        it as new list and returns pointer to this structure.
  545.  
  546.    INPUTS
  547.  
  548.    RESULTS
  549.        archiverlist -- a pointer to struct List. This list is used
  550.           for link the nodes each one is struct ArchiverNode. This
  551.           routine returns NULL if there isn't enough memory for
  552.           allocate the struct List.
  553.  
  554.    NOTE
  555.        In fact this routine does not special manipulations with
  556.        struct List with exception of initialization of the list
  557.        as new one. So you may allocate and initializate such list
  558.        yourself if you have the real reason for it.
  559.  
  560.    BUGS
  561.        None
  562.  
  563.    SEE ALSO
  564.        MP_FreeArchiverList(), MP_InsertArchiver(), MP_ToArchiver(),
  565.        MP_NextArchiver(), MP_PrevArchiver(), MP_IdentifyArchive()
  566.  
  567. mailpro.library/MP_InsertArchiver    mailpro.library/MP_InsertArchiver
  568.  
  569.    NAME
  570.        MP_InsertArchiver - Create archiver descriptor and link it to archivers' list.
  571.  
  572.    SYNOPSIS
  573.        archiver = MP_InsertArchiver(archiverlist, seq, pack, unpack)
  574.          D0                  A0    A1    A2    A3
  575.  
  576.        struct ArchiverNode *MP_InsertArchiver(struct List *, STRPTR, STRPTR, STRPTR)
  577.  
  578.    FUNCTION
  579.        This routine creates struct ArchiverNode, fills its fields
  580.        and inserts this node to archiverlist.
  581.  
  582.    INPUTS
  583.        archiverlist -- a pointer to struct List in which the node
  584.           will be inserted.
  585.        seq -- a pointer to the string which describes procedure of
  586.           archive type recognization. This string may contain
  587.           special tokens such us:
  588.  
  589.           OFFSET:
  590.                  Offset in bytes from beginning of file to start
  591.                  comparation from. It must be followed by any decimal
  592.                  (example: 25), hexadecimal (0x2e) or octal (04)
  593.                  number. If it isn't indicated then default value 0
  594.                  will be used. At this moment the maximal depth of
  595.                  comparation is 256 bytes.
  596.           CHRS:
  597.                  the characters for comparation (ex, -lh5-);
  598.           BIN:
  599.                  the values for comparation (ex, 0x20 0x34 0x02). Any
  600.                  base (octal, decimal and hexadecimal) and its mixing
  601.                  are possible.
  602.  
  603.        pack -- a pointer to the string which describe comand for create
  604.           (packing) archive.
  605.        unpack -- a pointer to the string which describe comand for
  606.           extract files (unpacking archive).
  607.  
  608.    RESULTS
  609.        archiver -- a pointer to struct ArchiverNode which was inserted
  610.           in list. This routine returns NULL if there isn't enough
  611.           memory for allocate the struct ArchiverNode and for strings'
  612.           buffers.
  613.  
  614.    NOTE
  615.        You must indicate in string of seq parameter only one type of
  616.        comparation: CHRS: or BIN:. Both ones in one string aren't
  617.        supported. Also note that this routine copies all strings into
  618.        private buffers so you may trash original strings after this
  619.        call.
  620.  
  621.    EXAMPLE
  622.        MP_InsertArchiver(archiverlist, "OFFSET:2 CHRS:-lh5-", "C:lha a", "C:lha e");
  623.  
  624.    BUGS
  625.        None
  626.  
  627.    SEE ALSO
  628.        MP_RemoveArchiver(), MP_NextArchiver(), MP_PrevArchiver(),
  629.        MP_ToArchiver(), MP_FreeArchiverList()
  630.  
  631. mailpro.library/MP_RemoveArchiver    mailpro.library/MP_RemoveArchiver
  632.  
  633.    NAME
  634.        MP_RemoveArchiver - Unlink archiver descriptor from archivers' list and deallocate it.
  635.  
  636.    SYNOPSIS
  637.        MP_RemoveArchiver(archiver)
  638.                              A0
  639.  
  640.        void MP_RemoveArchiver(struct ArchiverNode *)
  641.  
  642.    FUNCTION
  643.        This routine removes archiver descriptor from archivers' list
  644.        AND deallocates memory which was allocated for struct ArchiverNode
  645.        and for strings' private buffers.
  646.  
  647.    INPUTS
  648.        archiver -- a pointer to struct ArchiverNode which will be
  649.           removed and deallocated.
  650.  
  651.    RESULTS
  652.  
  653.    NOTE
  654.  
  655.    BUGS
  656.        None
  657.  
  658.    SEE ALSO
  659.        MP_InsertArchiver(), MP_NextArchiver(), MP_PrevArchiver(),
  660.        MP_ToArchiver(), MP_FreeArchiverList()
  661.  
  662. mailpro.library/MP_FreeArchiverList  mailpro.library/MP_FreeArchiverList
  663.  
  664.    NAME
  665.        MP_FreeArchiverList - Deallocate all archivers' descriptors and archivers' list.
  666.  
  667.    SYNOPSIS
  668.        MP_FreeArchiverList(archiverlist)
  669.                              A0
  670.  
  671.        void MP_FreeArchiverList(struct List *)
  672.  
  673.    FUNCTION
  674.        This routine removes all archivers' descriptors from archivers' list
  675.        AND deallocates memory which was allocated for all struct ArchiverNode,
  676.        for all private buffers and for the list.
  677.  
  678.    INPUTS
  679.        archiverlist -- a pointer to struct List which links archivers'
  680.           descriptors.
  681.  
  682.    RESULTS
  683.  
  684.    NOTE
  685.  
  686.    BUGS
  687.        None
  688.  
  689.    SEE ALSO
  690.        MP_AllocArchiverList(), MP_InsertArchiver(),
  691.        MP_RemoveArchiver()
  692.  
  693. mailpro.library/MP_NextArchiver      mailpro.library/MP_NextArchiver
  694.  
  695.    NAME
  696.        MP_NextArchiver - Go to next archiver descriptor after indicated.
  697.  
  698.    SYNOPSIS
  699.        archiver = MP_NextArchiver(archiver)
  700.          D0                  A0
  701.  
  702.        struct ArchiverNode *MP_NextArchiver(struct ArchiverNode *)
  703.  
  704.    FUNCTION
  705.        This routine returns pointer to the next archiver descriptor
  706.        which is after selected.
  707.  
  708.    INPUTS
  709.        archiver -- a pointer to the current struct ArchiverNode.
  710.  
  711.    RESULTS
  712.        archiver -- a pointer to the next struct ArchiverNode.
  713.           This routine returns NULL if current archiver descriptor
  714.           is last descriptor in the list (there are no more
  715.           descriptors after current one).
  716.  
  717.    NOTE
  718.  
  719.    BUGS
  720.        None
  721.  
  722.    SEE ALSO
  723.       MP_PrevArchiver(), MP_ToArchiver(), MP_InsertArchiver(),
  724.       MP_RemoveArchiver()
  725.  
  726. mailpro.library/MP_ToArchiver        mailpro.library/MP_ToArchiver
  727.  
  728.    NAME
  729.        MP_ToArchiver - Go to archiver descriptor by number of one.
  730.  
  731.    SYNOPSIS
  732.        archiver = MP_ToArchiver(archiverlist, number)
  733.          D0                  A0    D0
  734.  
  735.        struct ArchiverNode *MP_ToArchiver(struct List *, ULONG)
  736.  
  737.    FUNCTION
  738.        This routine returns pointer to the archiver descriptor in the
  739.        list by the number of one.
  740.  
  741.    INPUTS
  742.        archiverlist -- a pointer to struct List which links all
  743.           archivers' descriptors.
  744.        number -- a number of descriptor in the list (0, 1 etc).
  745.  
  746.    RESULTS
  747.        archiver -- a pointer to struct ArchiverNode.
  748.           This routine returns NULL if archive descriptor with selected
  749.           number is absent in the list.
  750.    NOTE
  751.  
  752.    BUGS
  753.        None
  754.  
  755.    SEE ALSO
  756.        MP_NextArchiver(), MP_PrevArchiver(), MP_InsertArchiver(),
  757.        MP_RemoveArchiver()
  758.  
  759. mailpro.library/MP_IdentifyArchive   mailpro.library/MP_IdentifyArchive
  760.  
  761.    NAME
  762.        MP_IdentifyArchive - Examine archive file and find needed archiver.
  763.  
  764.    SYNOPSIS
  765.        archiver = MP_IdentifyArchive(arcname, archiverlist, error)
  766.          D0                  A0    A1    A2
  767.  
  768.        struct ArchiverNode *MP_IdentifyArchive(STRPTR, struct List *, LONG *)
  769.  
  770.    FUNCTION
  771.        This routine examine archive file and trace list of archivers'
  772.        descriptors for search first suitable archiver descriptor.
  773.  
  774.    INPUTS
  775.        arcname -- a pointer to the name of archive file
  776.        archiverlist -- a pointer to struct List which links all
  777.           archivers' descriptors.
  778.        error -- a pointer to LONG value where any error code will
  779.           be placed. This parameter may be NULL. In this case error
  780.           code will not be placed anywhere.
  781.  
  782.    RESULTS
  783.        archiver -- a pointer to struct ArchiverNode which is descriptor
  784.           of suitable archiver. This routine returns NULL if suitable
  785.           archive descriptor was not found or if any error was occured.
  786.           In second case you may check error parameter for error code.
  787.    NOTE
  788.  
  789.    BUGS
  790.        None
  791.  
  792.    SEE ALSO
  793.        MP_InsertArchiver()
  794.  
  795. mailpro.library/MP_CvtEndianWord     mailpro.library/MP_CvtEndianWord
  796.  
  797.    NAME
  798.        MP_CvtEndianWord - Convert UWORD value between two formats.
  799.  
  800.    SYNOPSIS
  801.        number = MP_CvtEndianWord(number)
  802.          D0                  D0
  803.  
  804.        UWORD MP_CvtEndianWord(UWORD)
  805.  
  806.    FUNCTION
  807.        This routine converts input UWORD value between Big-Endian and
  808.        Little-Endian formats and vice versa. In fact 68K processors use
  809.        Big-Endian format (highest byte in beginning). But most fields
  810.        of mail packets are stored in Little-Endian format.
  811.  
  812.    INPUTS
  813.        number -- a value in one format.
  814.  
  815.    RESULTS
  816.        number -- a value in other format.
  817.  
  818.    NOTE
  819.  
  820.    BUGS
  821.        None
  822.  
  823.    SEE ALSO
  824.        MP_CvtEndianLong()
  825.  
  826. mailpro.library/MP_CvtEndianLong     mailpro.library/MP_CvtEndianLong
  827.  
  828.    NAME
  829.        MP_CvtEndianLong - Convert ULONG value between two formats.
  830.  
  831.    SYNOPSIS
  832.        number = MP_CvtEndianWord(number)
  833.          D0                  D0
  834.  
  835.        ULONG MP_CvtEndianWord(ULONG)
  836.  
  837.    FUNCTION
  838.        This routine converts input ULONG value between Big-Endian and
  839.        Little-Endian formats and vice versa. In fact 68K processors use
  840.        Big-Endian format (highest byte in beginning). But most fields
  841.        of mail packets are stored in Little-Endian format.
  842.  
  843.    INPUTS
  844.        number -- a value in one format.
  845.  
  846.    RESULTS
  847.        number -- a value in other format.
  848.  
  849.    NOTE
  850.  
  851.    BUGS
  852.        None
  853.  
  854.    SEE ALSO
  855.        MP_CvtEndianWord()
  856.  
  857. mailpro.library/MP_PrevMessage       mailpro.library/MP_PrevMessage
  858.  
  859.    NAME
  860.        MP_PrevMessage - Go to previous packet message before indicated.
  861.  
  862.    SYNOPSIS
  863.        message = MP_PrevMessage(message)
  864.          D0                  A0
  865.  
  866.        struct MailMessage *MP_PrevMessage(struct MailMessage *)
  867.  
  868.    FUNCTION
  869.        This routine returns pointer to the previous packet message
  870.        which is before selected.
  871.  
  872.    INPUTS
  873.        message -- a pointer to the current struct MailMessage.
  874.  
  875.    RESULTS
  876.        message -- a pointer to the previous struct MailMessage.
  877.           This routine returns NULL if current message is first
  878.           message in the mail packet (there are no messages
  879.           before current one).
  880.  
  881.    NOTE
  882.  
  883.    BUGS
  884.        None
  885.  
  886.    SEE ALSO
  887.        MP_NextMessage(), MP_ToMessage(), MP_CreateMessage(),
  888.        MP_InsertMessage(), MP_DeleteMessage()
  889.  
  890. mailpro.library/MP_PrevEntry         mailpro.library/MP_PrevEntry
  891.  
  892.    NAME
  893.        MP_PrevEntry - Go to previous message entry before indicated.
  894.  
  895.    SYNOPSIS
  896.        entry = MP_PrevEntry(entry)
  897.          D0                  A0
  898.  
  899.        struct MessageEntry *MP_PrevEntry(struct MessageEntry *)
  900.  
  901.    FUNCTION
  902.        This routine returns pointer to the previous message entry
  903.        which is before selected.
  904.  
  905.    INPUTS
  906.        entry -- a pointer to the current struct MessageEntry.
  907.  
  908.    RESULTS
  909.        entry -- a pointer to the previous struct MessageEntry.
  910.           This routine returns NULL if current entry is first
  911.           entry in the packet message (there are no entries
  912.           before current one).
  913.  
  914.    NOTE
  915.  
  916.    BUGS
  917.        None
  918.  
  919.    SEE ALSO
  920.        MP_NextEntry(), MP_ToEntry(), MP_FindEntry(), MP_CreateEntry(),
  921.        MP_InsertEntry(), MP_DeleteEntry()
  922.  
  923. mailpro.library/MP_PrevArchiver      mailpro.library/MP_PrevArchiver
  924.  
  925.    NAME
  926.        MP_PrevArchiver - Go to previous archiver descriptor before indicated.
  927.  
  928.    SYNOPSIS
  929.        archiver = MP_PrevArchiver(archiver)
  930.          D0                  A0
  931.  
  932.        struct ArchiverNode *MP_PrevArchiver(struct ArchiverNode *)
  933.  
  934.    FUNCTION
  935.        This routine returns pointer to the previous archiver descriptor
  936.        which is before selected.
  937.  
  938.    INPUTS
  939.        archiver -- a pointer to the current struct ArchiverNode.
  940.  
  941.    RESULTS
  942.        archiver -- a pointer to the previous struct ArchiverNode.
  943.           This routine returns NULL if current archiver descriptor
  944.           is first descriptor in the list (there are no descriptors
  945.           before current one).
  946.  
  947.    NOTE
  948.  
  949.    BUGS
  950.        None
  951.  
  952.    SEE ALSO
  953.       MP_NextArchiver(), MP_ToArchiver(), MP_InsertArchiver(),
  954.       MP_RemoveArchiver()
  955.  
  956. mailpro.library/MP_CreateEntry       mailpro.library/MP_CreateEntry
  957.  
  958.    NAME
  959.        MP_CreateEntry - Create new message entry.
  960.  
  961.    SYNOPSIS
  962.        entry = MP_CreateEntry(contents, size)
  963.          D0                  A0    D0
  964.  
  965.        struct MessageEntry *MP_CreateEntry(STRPTR, ULONG)
  966.  
  967.    FUNCTION
  968.        This routine allocates memory needed for struct MessageEntry and
  969.        for private buffer, copies entry contents into this buffer and
  970.        returns pointer to created entry.
  971.  
  972.    INPUTS
  973.        contents -- a pointer to buffer where entry contents is placed.
  974.        size -- a number of bytes which is lenght of entry contents.
  975.  
  976.    RESULTS
  977.        entry -- a pointer to the new struct MessageEntry. This routine
  978.           returns NULL if there isn't enough memory for creation.
  979.  
  980.    NOTE
  981.        This routine copies entry contents into private buffer so you
  982.        may trash original buffer after this call. Also please note
  983.        that you must call MP_DeleteEntry() for this entry if you don't
  984.        need with it anymore. Nevertheless if you link this entry in
  985.        any mail message by MP_InsertEntry() then you may free all
  986.        memory allocated for this entry by calling MP_DeleteMessage()
  987.        without call MP_DeleteEntry(). It is important!
  988.  
  989.    BUGS
  990.        None
  991.  
  992.    SEE ALSO
  993.        MP_InsertEntry(), MP_DeleteEntry()
  994.  
  995. mailpro.library/MP_CreateMessage     mailpro.library/MP_CreateMessage
  996.  
  997.    NAME
  998.        MP_CreateMessage - Create new mail message.
  999.  
  1000.    SYNOPSIS
  1001.        message = MP_CreateMessage(header)
  1002.          D0                  A0
  1003.  
  1004.        struct MailMessage *MP_CreateMessage(struct MessageHeader *)
  1005.  
  1006.    FUNCTION
  1007.        This routine allocates memory needed for struct MailMessage and
  1008.        for private buffer, copies message header into this buffer and
  1009.        returns pointer to created message.
  1010.  
  1011.    INPUTS
  1012.        header -- a pointer to buffer where message header is placed.
  1013.  
  1014.    RESULTS
  1015.        message -- a pointer to the new struct MailMessage. This routine
  1016.           returns NULL if there isn't enough memory for creation.
  1017.  
  1018.    NOTE
  1019.        This routine copies message header into private buffer so you
  1020.        may trash original header buffer after this call. Also please
  1021.        note that you must call MP_DeleteMessage() for this message if
  1022.        you don't need with it anymore. Nevertheless if you link this
  1023.        message in any mail packet by MP_InsertMessage() then you may
  1024.        free all memory allocated for this message by calling
  1025.        MP_FreePacket() without call MP_DeleteMessage(). It is
  1026.        important!
  1027.  
  1028.    BUGS
  1029.        None
  1030.  
  1031.    SEE ALSO
  1032.        MP_InsertMessage(), MP_DeleteMessage()
  1033.  
  1034. mailpro.library/MP_CreatePacket      mailpro.library/MP_CreatePacket
  1035.  
  1036.    NAME
  1037.        MP_CreatePacket - Create new mail packet.
  1038.  
  1039.    SYNOPSIS
  1040.        packet = MP_CreatePacket(header)
  1041.          D0                  A0
  1042.  
  1043.        struct MailPacket *MP_CreatePacket(struct PacketHeader *)
  1044.  
  1045.    FUNCTION
  1046.        This routine allocates memory needed for struct MailPacket and
  1047.        for private buffer, copies packet header into this buffer and
  1048.        returns pointer to created packet.
  1049.  
  1050.    INPUTS
  1051.        header -- a pointer to buffer where packet header is placed.
  1052.  
  1053.    RESULTS
  1054.        packet -- a pointer to the new struct MailPacket. This routine
  1055.           returns NULL if there isn't enough memory for creation.
  1056.  
  1057.    NOTE
  1058.        This routine copies packet header into private buffer so you
  1059.        may trash original header buffer after this call. Also please
  1060.        note that you must call MP_FreePacket() for this packet if
  1061.        you don't need with it anymore.
  1062.  
  1063.    BUGS
  1064.        None
  1065.  
  1066.    SEE ALSO
  1067.        MP_AllocPacket(), MP_FreePacket()
  1068.  
  1069. mailpro.library/MP_DeleteEntry       mailpro.library/MP_DeleteEntry
  1070.  
  1071.    NAME
  1072.        MP_DeleteEntry - Delete message entry.
  1073.  
  1074.    SYNOPSIS
  1075.        MP_DeleteEntry(entry)
  1076.                              A0
  1077.  
  1078.        void MP_DeleteEntry(struct MessageEntry *)
  1079.  
  1080.    FUNCTION
  1081.        This routine deallocates memory which was allocated for entry
  1082.        and for private buffer if it was used.
  1083.  
  1084.    INPUTS
  1085.        entry -- a pointer to struct MessageEntry which will be deleted.
  1086.  
  1087.    RESULTS
  1088.  
  1089.    NOTE
  1090.        The routine also checks is indicated entry linked into any mail
  1091.        message. If does then the routine also unlinks entry from this
  1092.        root message and modifies some fields of struct MailMessage
  1093.        (such us mm_Size, mm_NumEntries and mm_Status). Moreover if root
  1094.        message is linked in any mail packet then the routine also
  1095.        modifies field mp_Size of root struct MailPacket. Please don't
  1096.        use entry pointer after this call anymore!
  1097.  
  1098.    BUGS
  1099.        None
  1100.  
  1101.    SEE ALSO
  1102.        MP_CreateEntry(), MP_InsertEntry()
  1103.  
  1104. mailpro.library/MP_DeleteMessage     mailpro.library/MP_DeleteMessage
  1105.  
  1106.    NAME
  1107.        MP_DeleteMessage - Delete mail message.
  1108.  
  1109.    SYNOPSIS
  1110.        MP_DeleteMessage(message)
  1111.                              A0
  1112.  
  1113.        void MP_DeleteMessage(struct MailMessage *)
  1114.  
  1115.    FUNCTION
  1116.        This routine deallocates memory which was allocated for message
  1117.        and for private buffer if it was used. The routine frees ALSO
  1118.        memory of all message entries which are linked in this message.
  1119.  
  1120.    INPUTS
  1121.        message -- a pointer to struct MailMessage which will be deleted.
  1122.  
  1123.    RESULTS
  1124.  
  1125.    NOTE
  1126.        Please note that this routine frees ALSO memory of all message
  1127.        entries which are linked in this message and you must NOT call
  1128.        MP_DeleteEntry() for such entries after this call. The routine
  1129.        also checks is indicated message linked into any mail packet.
  1130.        If does then the routine also unlinks message from this root
  1131.        packet and modifies some fields of struct MailPacket (such us
  1132.        mp_Size, mp_NumMess and mp_Status). Please don't use message
  1133.        pointer after this call anymore!
  1134.  
  1135.    BUGS
  1136.        None
  1137.  
  1138.    SEE ALSO
  1139.        MP_CreateMessage(), MP_InsertMessage()
  1140.  
  1141. mailpro.library/MP_InsertEntry       mailpro.library/MP_InsertEntry
  1142.  
  1143.    NAME
  1144.        MP_InsertEntry - Insert entry into mail message.
  1145.  
  1146.    SYNOPSIS
  1147.        MP_InsertEntry(entry, message, number)
  1148.                              A0    A1    D0
  1149.  
  1150.        void MP_InsertEntry(struct MessageEntry *, struct MailMessage *, ULONG)
  1151.  
  1152.    FUNCTION
  1153.        This routine links indicated entry to mail message in position
  1154.        selected by number. This routine also modifies some fields of
  1155.        struct MailMessage (such us mm_Size, mm_NumEntries and mm_Status).
  1156.        Moreover if the message is linked in any mail packet then the
  1157.        routine also modifies field mp_Size of root struct MailPacket.
  1158.  
  1159.    INPUTS
  1160.        entry -- a pointer to struct MessageEntry which will be inserted.
  1161.        message -- a pointer to struct MailMessage which entry will be inserted in.
  1162.        number -- a number of position for entry in the message (0, 1 etc).
  1163.  
  1164.    RESULTS
  1165.  
  1166.    NOTE
  1167.        If number is above of number of last message entry then the
  1168.        routine links entry at tail of message. Also note that you
  1169.        must NOT insert entries which are already linked in any
  1170.        messages. If you try to do it then routine doesn't link such
  1171.        entry twice. It is important! If you need to insert some
  1172.        entry which is already linked then you must before create
  1173.        copy of this entry by MP_CreateEntry().
  1174.  
  1175.    BUGS
  1176.        None
  1177.  
  1178.    SEE ALSO
  1179.        MP_CreateEntry(), MP_DeleteEntry()
  1180.  
  1181. mailpro.library/MP_InsertMessage     mailpro.library/MP_InsertMessage
  1182.  
  1183.    NAME
  1184.        MP_InsertMessage - Insert message into mail packet.
  1185.  
  1186.    SYNOPSIS
  1187.        MP_InsertMessage(message, packet, number)
  1188.                              A0    A1    D0
  1189.  
  1190.        void MP_InsertMessage(struct MailMessage *, struct MailPacket *, ULONG)
  1191.  
  1192.    FUNCTION
  1193.        This routine links indicated message to mail packet in position
  1194.        selected by number. This routine also modifies some fields of
  1195.        struct MailPacket (such us mp_Size, mp_NumMess and mp_Status).
  1196.  
  1197.    INPUTS
  1198.        message -- a pointer to struct MailMessage which will be inserted.
  1199.        packet -- a pointer to struct MailPacket which message will be inserted in.
  1200.        number -- a number of position for message in the packet (0, 1 etc).
  1201.  
  1202.    RESULTS
  1203.  
  1204.    NOTE
  1205.        If number is above of number of last message in packet then
  1206.        the routine links message at tail of packet. Also note that
  1207.        you must NOT insert messages which are already linked in any
  1208.        packets. If you try to do it then routine doesn't link such
  1209.        message twice. It is important! If you need to insert some
  1210.        message which is already linked then you must before create
  1211.        copy of this message and all its entries by MP_CreateMessage(),
  1212.        MP_CreateEntry() and MP_InsertEntry().
  1213.  
  1214.    BUGS
  1215.        None
  1216.  
  1217.    SEE ALSO
  1218.        MP_CreateMessage(), MP_DeleteMessage(), MP_CreateEntry(), MP_InsertEntry()
  1219.  
  1220. mailpro.library/MP_RootMessage       mailpro.library/MP_RootMessage
  1221.  
  1222.    NAME
  1223.        MP_RootMessage - Search for the root mail message of entry.
  1224.  
  1225.    SYNOPSIS
  1226.        message = MP_RootMessage(entry)
  1227.          D0                  A0
  1228.  
  1229.        struct MailMessage *MP_RootMessage(struct MessageEntry *)
  1230.  
  1231.    FUNCTION
  1232.        This routine examines message entry and try to find root
  1233.        message for this entry if entry is linked in any message.
  1234.  
  1235.    INPUTS
  1236.        entry -- a pointer to struct MessageEntry.
  1237.  
  1238.    RESULTS
  1239.        message -- a pointer to struct MailMessage which the entry
  1240.           is linked to. This routine returns NULL if the indicated
  1241.           entry is not linked to any mail message.
  1242.  
  1243.    NOTE
  1244.        The usage of this routine is only one valid way to search
  1245.        root message pointer due the size of most structures may
  1246.        be changed in next versions of library. And this routine
  1247.        also may help you to determine has entry been linked to any
  1248.        mail message or don't.
  1249.  
  1250.    BUGS
  1251.        None
  1252.  
  1253.    SEE ALSO
  1254.        MP_InsertEntry()
  1255.  
  1256. mailpro.library/MP_RootPacket        mailpro.library/MP_RootPacket
  1257.  
  1258.    NAME
  1259.        MP_RootPacket - Search for the root mail packet of message.
  1260.  
  1261.    SYNOPSIS
  1262.        packet = MP_RootPacket(message)
  1263.          D0                  A0
  1264.  
  1265.        struct MailPacket *MP_RootPacket(struct MailMessage *)
  1266.  
  1267.    FUNCTION
  1268.        This routine examines mail message and try to find root
  1269.        packet for this message if message is linked in any packet.
  1270.  
  1271.    INPUTS
  1272.        message -- a pointer to struct MailMessage.
  1273.  
  1274.    RESULTS
  1275.        packet -- a pointer to struct MailPacket which the message
  1276.           is linked to. This routine returns NULL if the indicated
  1277.           mail message is not linked to any mail packet.
  1278.  
  1279.    NOTE
  1280.        The usage of this routine is only one valid way to search
  1281.        root packet pointer due the size of most structures may
  1282.        be changed in next versions of library. And this routine
  1283.        also may help you to determine has message been linked to
  1284.        any mail packet or don't.
  1285.  
  1286.    BUGS
  1287.        None
  1288.  
  1289.    SEE ALSO
  1290.        MP_InsertMessage()
  1291.  
  1292. mailpro.library/MP_UniqueName        mailpro.library/MP_UniqueName
  1293.  
  1294.    NAME
  1295.        MP_UniqueName - Generate unique file name.
  1296.  
  1297.    SYNOPSIS
  1298.        string = MP_UniqueName(buffer, extension)
  1299.          D0                  A0    A1
  1300.  
  1301.        STRPTR MP_UniqueName(STRPTR, STRPTR)
  1302.  
  1303.    FUNCTION
  1304.        This routine makes unique file name with 8 bytes lenght and
  1305.        adds extension to it.
  1306.  
  1307.    INPUTS
  1308.        buffer -- a pointer to buffer where unique name will be placed.
  1309.           The size of this buffer must be at least lenght of extension
  1310.           plus 8 bytes for file name plus 2 bytes for the dot and for
  1311.           NULL terminator.
  1312.        extension -- a pointer to extension of name. May be NULL if you
  1313.           don't need to use it. Don't use dot before extension because
  1314.           the routine adds it itself.
  1315.  
  1316.    RESULTS
  1317.        string -- a pointer to the buffer.
  1318.  
  1319.    NOTE
  1320.        This routine does not check buffer size overflow so you must pass
  1321.        buffer with enough space.
  1322.  
  1323.    BUGS
  1324.        None
  1325.  
  1326.    SEE ALSO
  1327.  
  1328. mailpro.library/MP_SavePacket        mailpro.library/MP_SavePacket
  1329.  
  1330.    NAME
  1331.        MP_SavePacket - Save whole packet into simple file.
  1332.  
  1333.    SYNOPSIS
  1334.        error = MP_SavePacket(packet, filename)
  1335.          D0                  A0    A1
  1336.  
  1337.        LONG MP_SavePacket(struct MailPacket *, STRPTR)
  1338.  
  1339.    FUNCTION
  1340.        This routine saves whole mail packet to simple file.
  1341.  
  1342.    INPUTS
  1343.        packet -- a pointer to struct MailPacket which will be saved.
  1344.        filename -- a name of file in which packet will be saved. It
  1345.           may contain the path. If no path is specified then the
  1346.           path related to current or program directory will be used.
  1347.           If you specify NULL here then packet name from field
  1348.           mp_Name will be used. If this field hasn't the name then
  1349.           new name will be generated by MP_UniqueName() and used.
  1350.  
  1351.    RESULTS
  1352.        error -- 0L if all is okay. If any internal error occurs then
  1353.           library error code will be returned. All internal error
  1354.           codes are negative values.
  1355.  
  1356.    NOTE
  1357.        This routine skips while saving all corrupted or empty
  1358.        messages and also skips corrupted entries. If any message
  1359.        has only corrupted entries then such message will be skiped
  1360.        too. Nevertheless this routine may produce the file which
  1361.        contains empty mail packet without mail messages due it is
  1362.        possible at FCS standard.
  1363.  
  1364.    BUGS
  1365.        None
  1366.  
  1367.    SEE ALSO
  1368.        MP_AllocPacket(), MP_FreePacket(), MP_CreatePacket()
  1369.  
  1370.  
  1371.